package com.yj.service.impl;

import org.springframework.stereotype.Service;

import com.yj.model.Admin;
import com.yj.model.Student;
import com.yj.model.Teacher;
import com.yj.service.UserService;

@Service("userService")
public class UserServiceImpl extends BaseServiceImpl<Object> implements UserService{

	@Override
	public Object login(Object object, Integer role) {
		if(role == 1) {
			Student student = (Student) object;
			return userDao.studentLogin(student);
		}else if(role == 2) {
            Teacher teacher = (Teacher)object;
            return userDao.teacherLogin(teacher);
		}else if(role == 3) {
            Admin admin = (Admin)object;
            return userDao.adminLogin(admin);
		}else {
			return null;
		}
	}

}
